package org.openclinic.repository;

import java.util.List;

import org.openclinic.domain.MedicalSpecialty;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

public interface MedicalSpecialtyRepository extends JpaRepository<MedicalSpecialty, Long> {
	
	@Query("SELECT DISTINCT ms FROM MedicalSpecialty ms JOIN ms.professionals ORDER BY ms.name")
	List<MedicalSpecialty> findAvailable();
	
}
